package tq.com.tqstudent.bean;

import com.lib.common.utils.LogUtil;

import java.util.List;

/**
 * @Author rames
 * @date 2019/3/27 10:47
 */
public class RecodeBean {
    public static final int TYPE_TITLE = 0; // 标题
    public static final int TYPE_CONTENT = 1; // 内容
    public static final int TYPE_TIME = 2; // 时间
    public static final int TYPE_IMAGE = 3;// 图片

    public int type;//item内容 类型


    public int material_id; // 资料id
    public String meterial_title; // 资料的标题
    public int meterial_cate;
    public int attachment_id; // 附件ID
    public String title; // 附件的标题
    public String content; // 附件的内容
    public String content_type; // 附件内容类型
    public int view_cnt;
    public String content_cover; // 附件的封面
    public String watch_sec; // 观看时长
    public String create_time; // 观看日期

    public int getType(){
        if(meterial_cate == 15){ // 微课
            type = TYPE_IMAGE;
        } else {
            type = TYPE_CONTENT;
        }
        return type; // 讲评
    }

    private RecodeBean(){}

    // 这个是针对于title那种的
    public static RecodeBean initTitle(String title){
        RecodeBean bean = new RecodeBean();
        bean.type = TYPE_TITLE;
        bean.meterial_title = title;
        return bean;
    }

    // 针对于时间的
    public static RecodeBean initTime(String cTime, String time){
        RecodeBean bean = new RecodeBean();
        bean.type = TYPE_TIME;
        bean.create_time = cTime;
        bean.watch_sec = time;
        return bean;
    }

    // 针对于只有内容的, 微课
    public static RecodeBean initContent(int material_id, String content, String url) {
        RecodeBean bean = new RecodeBean();
        bean.material_id = material_id;
        bean.type = TYPE_CONTENT;
        bean.meterial_title = content;
        bean.content = url;
        return bean;
    }

    // 针对于只有图片的, 讲评
    public static RecodeBean initImage(int material_id, String content, String contentCover, int viewCount) {
        RecodeBean bean = new RecodeBean();
        bean.material_id = material_id;
        bean.type = TYPE_IMAGE;
        bean.content = content;
        bean.view_cnt = viewCount;
        bean.content_cover = contentCover;
        return bean;
    }

//    public String title;
//    public List<String> contents;
//    public String time;
//    public List<String> images;
//
//    public RecodeBean(int type, String title, List<String> contents, String time, List<String> images){
//        this.type = type;
//        this.title = title;
//        this.contents = contents;
//        this.time = time;
//        this.images = images;
//    }
}
